package com.common.retrofit.methods;

import android.view.inputmethod.InputBinding;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.HomeRecommendBean;
import com.common.retrofit.entity.result.HouseListBean;
import com.common.retrofit.service.HaiNingService;

import java.util.ArrayList;

import rx.Observable;
import rx.Subscriber;

public class ScreenNewHouseMethods extends BaseMethods {

    private static ScreenNewHouseMethods m_ins = null;

    public static ScreenNewHouseMethods getInstance() {
        if (m_ins == null) {
            synchronized (ScreenNewHouseMethods.class) {
                if (m_ins == null) {
                    m_ins = new ScreenNewHouseMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "House/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 获取首页数据
    public void screen_new_house(Subscriber<ArrayList<HouseListBean>> subscriber, int page, String city_str, String area_str, int house_price, int house_type, int house_selling_point, int small_price, int big_price) {
        Observable observable = initService().screen_new_house(System.currentTimeMillis()+"",
                "3d5d380190a3fbeaeb6dccd26a9604fa",city_str,area_str,house_price,house_type,house_selling_point,small_price,big_price,page
        );
        toSubscribe(observable, subscriber);
    }
}
